<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.11"/>
<title>FaceRecognitionLib: Face Recognition Library</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<script type="text/javascript">
  $(document).ready(function() { init_search(); });
</script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td id="projectalign" style="padding-left: 0.5em;">
   <div id="projectname">FaceRecognitionLib
   </div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.11 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script>
  <div id="navrow1" class="tabs">
    <ul class="tablist">
      <li class="current"><a href="index.html"><span>Main&#160;Page</span></a></li>
      <li><a href="annotated.html"><span>Classes</span></a></li>
      <li><a href="files.html"><span>Files</span></a></li>
      <li>
        <div id="MSearchBox" class="MSearchBoxInactive">
        <span class="left">
          <img id="MSearchSelect" src="search/mag_sel.png"
               onmouseover="return searchBox.OnSearchSelectShow()"
               onmouseout="return searchBox.OnSearchSelectHide()"
               alt=""/>
          <input type="text" id="MSearchField" value="Search" accesskey="S"
               onfocus="searchBox.OnSearchFieldFocus(true)" 
               onblur="searchBox.OnSearchFieldFocus(false)" 
               onkeyup="searchBox.OnSearchFieldChange(event)"/>
          </span><span class="right">
            <a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a>
          </span>
        </div>
      </li>
    </ul>
  </div>
</div><!-- top -->
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<div class="header">
  <div class="headertitle">
<div class="title">Face Recognition Library </div>  </div>
</div><!--header-->
<div class="contents">
<div class="textblock"><h4>Developed by Kristian Lauszus, 2016</h4>
<p>The code is released under the GNU General Public License. </p><hr/>
<p>This library can be used in order to calculate <a href="http://www.face-rec.org/algorithms/PCA/jcn.pdf">Eigenfaces</a> and <a href="http://www.cs.columbia.edu/~belhumeur/journal/fisherface-pami97.pdf">Fisherfaces</a> in C++</p>
<p>This <a class="el" href="class_eigenfaces.html">Eigenfaces</a> are calculated efficiently as described in the <a href="http://www.face-rec.org/algorithms/PCA/jcn.pdf">paper</a> by M. Turk and A. Pentland.</p>
<p>The <a href="Eigenfaces.m">Eigenfaces.m</a> Matlab script was used for development and was then ported to C++.</p>
<p>If you want to convert the PGM image run the <a href="convert_pgm.sh">convert_pgm.sh</a> script.</p>
<h2>Documentation</h2>
<p>Some information can be found in the <a href="docs/Eigenfaces_Report.pdf">Eigenfaces_Report.pdf</a>.</p>
<p>The source is documentated using <a href="http://www.stack.nl/~dimitri/doxygen">Doxygen</a>. The documentation can be found at the following link: <a href="http://lauszus.github.io/FaceRecognitionLib">http://lauszus.github.io/FaceRecognitionLib</a>.</p>
<h2>AT&amp;T Facedatabase</h2>
<p>When using the code with the <a href="http://www.cl.cam.ac.uk/research/dtg/attarchive/facedatabase.html">AT&amp;T Facedatabase</a> the output looks like this:</p>
<h4><a class="el" href="class_eigenfaces.html">Eigenfaces</a>:</h4>
<div class="image">
<img src="img/eigenfaces_att.png"  width="300/"/>
</div>
 <div class="image">
<img src="img/matches_eigenfaces_att.png"  width="300/"/>
</div>
<h4><a class="el" href="class_fisherfaces.html">Fisherfaces</a>:</h4>
<div class="image">
<img src="img/fisherfaces_att.png"  width="300/"/>
</div>
 <div class="image">
<img src="img/matches_fisherfaces_att.png"  width="300/"/>
</div>
<p>Notice how the <a class="el" href="class_eigenfaces.html">Eigenfaces</a> is only slightly worse compared to <a class="el" href="class_fisherfaces.html">Fisherfaces</a>.</p>
<h2>Yale Face Database</h2>
<p>However when using the <a href="http://vision.ucsd.edu/content/yale-face-database">Yale Face Database</a> the difference is significant:</p>
<h4><a class="el" href="class_eigenfaces.html">Eigenfaces</a>:</h4>
<div class="image">
<img src="img/eigenfaces_yale.png"  width="300/"/>
</div>
 <div class="image">
<img src="img/matches_eigenfaces_yale.png"  width="300/"/>
</div>
<h4><a class="el" href="class_fisherfaces.html">Fisherfaces</a>:</h4>
<div class="image">
<img src="img/fisherfaces_yale.png"  width="300/"/>
</div>
 <div class="image">
<img src="img/matches_fisherfaces_yale.png"  width="300/"/>
</div>
<p>This clearly shows the weakness of <a class="el" href="class_eigenfaces.html">Eigenfaces</a>, as it only maximizes the scatter between classes and thus end up matching all images with light coming from the left side.</p>
<p>Note you need to prepare the Yale Face Database by running the <a href="convert_yalefaces.sh">convert_yalefaces.sh</a> script first.</p>
<h2>Android application</h2>
<p>This library was used for an <a href="https://github.com/Lauszus/FaceRecognitionApp">Android application</a>. Some screenshots can be seen below:</p>
<p><a href="https://github.com/Lauszus/FaceRecognitionApp"></a></p>
<h2>Build instructions</h2>
<p>In order to build the C++ code and run the script you need to install <a href="http://eigen.tuxfamily.org">Eigen3</a> and <a href="http://www.imagemagick.org">ImageMagick</a>:</p>
<p>Mac:</p>
<div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno">    1</span>&#160;brew install eigen imagemagick</div></div><!-- fragment --><p>Ubuntu:</p>
<div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno">    1</span>&#160;sudo apt-get install libeigen3-dev imagemagick</div></div><!-- fragment --><p>The <a href="https://github.com/ntessore/redsvd-h">RedSVD</a> library is included as a submodule.</p>
<p>For more information send me an email at <a href="#" onclick="location.href='mai'+'lto:'+'lau'+'sz'+'us@'+'gm'+'ail'+'.c'+'om'; return false;">lausz<span style="display: none;">.nosp@m.</span>us@g<span style="display: none;">.nosp@m.</span>mail.<span style="display: none;">.nosp@m.</span>com</a>. </p>
</div></div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated by &#160;<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.8.11
</small></address>
</body>
</html>
